package com.gjm.tool.utils;


import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.File;
import java.io.FileInputStream;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

public class Test {

    public static void main(String[] args) throws Exception{
        List<List<String>> list = ExcelUtil.readExcel("C:\\Users\\Administrator\\Desktop\\SQL编辑器导出-33872.xlsx", 0, Arrays.asList(0, 1, 2, 3));

        String baseSql = "INSERT INTO `sys_dept` (`dept_id`, `parent_id`, `ancestors`, `dept_name`, `order_num`, `leader`, `phone`, `email`, `status`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('100', '0', '0', '全国', '0', '北京总部', '15888888888', '', '0', '0', 'admin', '2023-07-13 14:37:18', 'admin', '2023-09-21 21:44:37') ;";
        for (List<String> stringList : list) {
            String sql = String.format(baseSql, stringList.get(0), stringList.get(1), stringList.get(2), stringList.get(3));
            System.out.println(sql);
        }

    }
}
